TEMP_DIR=`pwd`"/tmp/"
OLD_DIR=`pwd`

ROCK=$1
VERSION=$2

mkdir $TEMP_DIR/$ROCK

svn export rocks/$ROCK/lua $TEMP_DIR/$ROCK/lua
svn export rocks/$ROCK/rockspec $TEMP_DIR/$ROCK/$ROCK-$VERSION.rockspec
cd $TEMP_DIR/$ROCK
zip -r $OLD_DIR/rocks/$ROCK-$VERSION.all.rock *
cd $OLD_DIR
scp rocks/$ROCK-$VERSION.all.rock yuri@web10.webfaction.com:~/webapps/static/rocks/

echo "repository['$ROCK']['$VERSION']={ {arch='all'}, {arch='rockspec'} }" >> rocks/manifest
scp rocks/manifest yuri@web10.webfaction.com:~/webapps/static/rocks/

